<?php

namespace app\libs\WeChatSDK\Action;

use app\libs\WeChatSDK\WeChatClient;

class PushMessage extends WeChatClient
{
    public function pushMessage($content,$msgType = 'text')
    {
       $path = '/cgi-bin/webhook/send?key=' . self::APP_KEY;
       $json = [
           'msgtype' => $msgType,
           'text'=>[
               'content'=> $content,
           ],
       ];

       return $this->setPath($path)
           ->setMethod("POST")
           ->setOption(['json'=>$json])
           ->send();

    }
}